import random
import time

def abc(i):
    abcd=["平民","狼人","活","死"]
    return abcd[i]
def ab(i):
    abcde=["一","二","三","四"]
    return abcde[i]
def chu(a):
    if a==0:
        return abc(0)
    if a==1:
        return abc(1)
def chu1(a):
    if a==0:
        return abc(3)
    if a==1:
        return abc(2)
def win(a,s,d,f):
    if a[0]==1:
        if s[1]==0:
            if d[1]==0:
                if f[1]==0:
                    return 1
    if s[0]==1:
        if a[1]==0:
            if d[1]==0:
                if f[1]==0:
                    return 2
    if d[0]==1:
        if s[1]==0:
            if a[1]==0:
                if f[1]==0:
                    return 3
    if f[0]==1:
        if s[1]==0:
            if d[1]==0:
                if a[1]==0:
                    return 4
a=random.randint(0,3)
if a==0:
    r_1=[1,1]
    r_2=[0,1]
    r_3=[0,1]
    r_4=[0,1]
if a==1:
    r_1=[0,1]
    r_2=[1,1]
    r_3=[0,1]
    r_4=[0,1]
if a==2:
    r_1=[0,1]
    r_2=[0,1]
    r_3=[1,1]
    r_4=[0,1]
if a==3:
    r_1=[0,1]
    r_2=[0,1]
    r_3=[1,1]
    r_4=[0,1]
c=0
p=0
print(f"你是{chu(r_4[0])},还{chu1(r_4[1])}着")
time.sleep(1)
if r_4[0]==0:
    while p==0:
        print("该睡觉了")
        time.sleep(0.5)
        while c==0:
            b=random.randint(0,5)
            if b==0 and r_1[0]!=1 and r_1[1]==1:
                r_1[1]-=1
                c=1
            if b==1 and r_2[0]!=1 and r_2[1]==1:
                r_2[1]-=1
                c=1
            if b==2 and r_3[0]!=1 and r_3[1]==1:
                r_3[1]-=1
                c=1
            if b==3 and r_4[0]!=1 and r_4[1]==1:
                r_4[1]-=1
                c=1
        print("天亮了")
        print(f"1号玩家是{chu1(r_1[1])}的")
        print(f"2号玩家是{chu1(r_2[1])}的")
        print(f"3号玩家是{chu1(r_3[1])}的")
        print(f"4号玩家是{chu1(r_4[1])}的")
        time.sleep(1)
        l=int(input("谁是狼人?"))
        if l==1 and r_1[0]==1:
            print("win")
            p=1
        if l==2 and r_2[0]==1:
            print("win")
            p=1
        if l==3 and r_3[0]==1:
            print("win")
            p=1
        if win(r_1,r_2,r_3,r_4)==1:
            print("1win")
            p=1
        if win(r_1,r_2,r_3,r_4)==2:
            print("2win")
            p=1
        if win(r_1,r_2,r_3,r_4)==3:
            print("3win")
            p=1
        time.sleep(1)
        c=0
        """
        if r_1[1]==0:
            print("号玩家")
        elif r_2[1]==0:
        elif r_3[1]==0:
        elif r_4[1]==0:
        else:
            
if r_4[0]==1:
    while True:
        print("该睡觉了")
"""
"""

a=random.randint(0,8)
if a==0:
    a_1=1
    a_2=1
if a_1==0:
    a=1
    a_2=1
if a_2==0:
    a=1
    a_1=1
print(f"一号玩家是{abc(a_1)}")
print(f"二号玩家是{abc(a_2)}")
print(f"你是{abc(a)}")
print("该睡觉了")
if a==0:
    b=int(input("今晚要杀谁？"))
    if b==1:
        a_1=2
    if b==2:
        a_2=2
    print("他死了")
if a!=0:
    s=random.randint(0,1)
    if a_1==0:
        if s==0:
            a=2
        if s==1:
            a_2=0
    if a_2==0:
        if s==0:
            a==2
        if s==1:
            a_1=2

print("第二天")
if a!=2:
    print(f"你{abc(a)}")
    if a_1==2:
        print("一号玩家死了")
    if a_2==2:
        print("二号玩家死了")
    l=int(input("谁是狼人?"))
    if l==1:
        print(f"一号玩家是{abc(a_1)}")
    if l==2:
        print(f"二号玩家是{abc(a_2)}")
    if l==3:
        print("你死了")
if a==2:
    print("你死了")





def abc(i):
    abcd=["狼人","平民","死了","活了"]
    return abcd[i]
a=random.randint(0,1)
a_1=random.randint(0,1)
a_2=random.randint(0,1)
if a==0:
    a_1=1
    a_2=1
if a_1==0:
    a=1
    a_2=1
if a_2==0:
    a=1
    a_1=1
print(f"一号玩家是{abc(a_1)}")
print(f"二号玩家是{abc(a_2)}")
print(f"你是{abc(a)}")
print("该睡觉了")
if a==0:
    b=int(input("今晚要杀谁？"))
    if b==1:
        a_1=2
    if b==2:
        a_2=2
    print("他死了")
if a!=0:
    s=random.randint(0,1)
    if a_1==0:
        if s==0:
            a=2
        if s==1:
            a_2=0
    if a_2==0:
        if s==0:
            a==2
        if s==1:
            a_1=2

print("第二天")
if a!=2:
    print(f"你{abc(a)}")
    if a_1==2:
        print("一号玩家死了")
    if a_2==2:
        print("二号玩家死了")
    l=int(input("谁是狼人?"))
    if l==1:
        print(f"一号玩家是{abc(a_1)}")
    if l==2:
        print(f"二号玩家是{abc(a_2)}")
    if l==3:
        print("你死了")
if a==2:
    print("你死了")
"""